#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <cstdio>
#include <cstdlib>

#define PATH "./"
#define PROJID 0x66
#define ERR_EXIT(m)     \
do                      \
{                       \
    perror(m);          \
    exit(EXIT_FAILURE); \
} while (0);


int main()
{
    key_t key = ftok(PATH, PROJID);
    int n = shmget(key, 4096, IPC_CREAT);
    if(n < 0)
    {
        ERR_EXIT("shmget fail");
    }
    return 0;
}